package com.yuyou.fn.analyze.service;

import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.analyze.vo.*;
import com.yuyou.fn.educational.entity.ClassLecture;
import com.yuyou.fn.educational.entity.CourseClass;
import com.yuyou.fn.educational.entity.Product;
import com.yuyou.fn.platform.entity.SysUser;
import com.yuyou.fn.settlement.vo.FeeCategoryTreeMapVo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 *
 * ProductTarget 表数据服务层接口
 *
 */
public interface IProductStatisticsService {
    /*产品成本利润
    * 计算产品 在该时间段以考勤的讲次，讲次查出课程，课程查出业务组， 再查业务组再该段时间所有的讲次。 根据产品讲次 与业务组所有讲次占比，计算某些产品的成本类型
    * */
    List<ProductCostAndIncomeVo> findProductCostAndIncome(Date startDate, Date endDate, List<Product> productList);



    List<ProductCostAndIncomeVo> findProductCostAndIncome(List<Long> areaTeamIds,Date startDate, Date endDate, List<Product> productList, SysUser sysUser);



    List<ClassIncomeVo> findClassIncomeByProductId(Long productId,Date startDate,Date endDate);


    List<ClassIncomeVo> findClassIncomeByProductId(Long productId,Date startDate,Date endDate,SysUser sysUser);

    Page<ClassIncomeVo> findClassIncomePageByProductId(Long productId, Date startDate, Date endDate,SysUser sysUser, int pageNo,int pageSize);

    List<Long> filterBusTeamByPermissions(List<Long> busTeamIdList);



    List<BusTeamClassVo> findBusTeamsClassLeature(List<Long> busTeamIdList,List<CourseClass> courseClasseList,List<ClassLecture> classLectureList,Date startDate,Date endDate);


    List<CategoryMainAccountVo> calProductCostAlgorithm(List<ClassLecture> classLectureList, List<CourseClass> productCourseClassList, Long mainAccountId, List<CategoryMainAccountVo> categoryMainAccountVoList, Integer busTeamTotalLetcure, Integer productLetcure, Date startDate, Date endDate );

    List<ProductCostByCategoryVo> findProductCategoryCostByProductId(Long productId, Date startDate, Date endDate);

    List<Long> busTeamIdListByProductIds(List<Long> productIdList,Date startDate,Date endDate);

    List<TeacherClassCostVo> productClassRemunerationDetail(Long productId,Long feeCategoryId, Date startDate, Date endDate);

    List<TeacherClassCostVo> productClassRemunerationDetail(Long productId,Long feeCategoryId, Date startDate, Date endDate,SysUser sysUser);

    Page<TeacherClassCostVo> productClassRemunerationPage(Long productId,Long feeCategoryId, Date startDate, Date endDate,SysUser sysUser,int pageNo,int pageSize);

    ProductCostDetailVo findCostDetailByDetailType(Integer detailType,Long feeCategoryId,Long productId,Date startDate,Date endDate);

    ProductCostDetailVo findCostDetailByDetailType(Integer detailType,Long feeCategoryId,Long productId,Date startDate,Date endDate,SysUser sysUser);

    ProductCostDetailVo findProductCostDetail(Integer detailType,Long feeCategoryId,Long productId,Date startDate,Date endDate,SysUser sysUser,int pageNo,int pageSize);

    public BigDecimal calLeaveOfClassLecture(List<ClassLecture> classLectureList);

    List<ProductCostByCategoryVo> findProductCategoryCostByProductId(List<FeeCategoryTreeMapVo> feeCategoryTreeMapVoList, Long productId, Date startDate, Date endDate);


    List<ProductCostByCategoryVo> findProductCategoryCostByProductId(List<FeeCategoryTreeMapVo> feeCategoryTreeMapVoList, Long productId, Date startDate, Date endDate,SysUser sysUser);


}